-
-
Notifications
You must be signed in to change notification settings - Fork 132
Available serialize enum #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi, thank you for the pull request which looks very good. I have a few questions though:
|
# Conflicts: # tests/EnumTest.php
Received many complaints that it is impossible to serialize the list. Apparently, there is a demand for this. An attempt to unserialize the list results in error:
|
It would be breaking the serialization format. So if anyone has stored (in database or anywhere else) serialized enums, that change would break everything that has been stored. This is unfortunately a major BC break. Maybe there is a way to keep supporting the old serialization format? |
Yes. BC break. I add tests for check current serialize format #50 If you look, you will see that the output string is binary. Perhaps you are right. |
Thank you for #50, it's now clearer. I don't understand why it's serialized as a binary string but I guess it's not the real problem here. So the big issue is backward compatibility with enums that have already been serialized by users and stored in database (for example). But you said:
So right now is it possible to deserialize an enum? If it's not possible it means serialization is broken and we can merge your pull request, it will not break an existing feature since serialization doesn't work. |
I mistake. Now deserialize works. I serialized the enum to a file and successfully deserialized it. |
Thanks, that confirms my quick tests too. So I'm afraid we can't break backward compatibility :/ |
In this case, i propose to conclude the discussion of this subject. |
👍 thank you |
See tests as how to usage